package com.ruoyi.second.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.second.mapper.CommunityTransactionMapper;
import com.ruoyi.second.domain.CommunityTransaction;
import com.ruoyi.second.service.ICommunityTransactionService;

/**
 * 小区成交记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class CommunityTransactionServiceImpl implements ICommunityTransactionService 
{
    @Autowired
    private CommunityTransactionMapper communityTransactionMapper;

    /**
     * 查询小区成交记录
     * 
     * @param id 小区成交记录主键
     * @return 小区成交记录
     */
    @Override
    public CommunityTransaction selectCommunityTransactionById(Long id)
    {
        return communityTransactionMapper.selectCommunityTransactionById(id);
    }

    /**
     * 查询小区成交记录列表
     * 
     * @param communityTransaction 小区成交记录
     * @return 小区成交记录
     */
    @Override
    public List<CommunityTransaction> selectCommunityTransactionList(CommunityTransaction communityTransaction)
    {
        return communityTransactionMapper.selectCommunityTransactionList(communityTransaction);
    }

    /**
     * 新增小区成交记录
     * 
     * @param communityTransaction 小区成交记录
     * @return 结果
     */
    @Override
    public int insertCommunityTransaction(CommunityTransaction communityTransaction)
    {
        communityTransaction.setCreateTime(DateUtils.getNowDate());
        return communityTransactionMapper.insertCommunityTransaction(communityTransaction);
    }

    /**
     * 修改小区成交记录
     * 
     * @param communityTransaction 小区成交记录
     * @return 结果
     */
    @Override
    public int updateCommunityTransaction(CommunityTransaction communityTransaction)
    {
        return communityTransactionMapper.updateCommunityTransaction(communityTransaction);
    }

    /**
     * 批量删除小区成交记录
     * 
     * @param ids 需要删除的小区成交记录主键
     * @return 结果
     */
    @Override
    public int deleteCommunityTransactionByIds(Long[] ids)
    {
        return communityTransactionMapper.deleteCommunityTransactionByIds(ids);
    }

    /**
     * 删除小区成交记录信息
     * 
     * @param id 小区成交记录主键
     * @return 结果
     */
    @Override
    public int deleteCommunityTransactionById(Long id)
    {
        return communityTransactionMapper.deleteCommunityTransactionById(id);
    }
}
